# Contributor: Anjandev Momi <anjan@momi.ca>
# Maintainer: Anjandev Momi <anjan@momi.ca>
pkgname=py3-loguru
_pkgreal=loguru
pkgver=0.7.2
pkgrel=2
pkgdesc="Python logging made (stupidly) simple"
url="https://pypi.org/project/loguru"
arch="noarch"
license="MIT"
depends="python3 py3-colorama"
checkdepends="py3-pytest py3-freezegun py3-mypy"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
subpackages="$pkgname-pyc"
source="$_pkgreal-$pkgver.tar.gz::https://github.com/Delgan/loguru/archive/refs/tags/$pkgver.tar.gz"
builddir="$srcdir/$_pkgreal-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
e4d358f12ec33393bdac836206a15a3161653684b69839f58bbdc692155e4aee4b6ec700ab13b83f431a67df5ec86cacf2cb90fa052827e5e03c68c1f132e339  loguru-0.7.2.tar.gz
"
